﻿/*
 * Created by SharpDevelop.
 * User: rogerio
 * Date: 28/12/2009
 * Time: 14:26
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;

namespace csharp.rad.general.views
{
	/// <summary>
	/// Description of stock.
	/// </summary>
	public partial class frmStock : KryptonForm
	{
		private Warehouses listWarehouses = new Warehouses();
		
		public frmStock()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
		}
		
		void StockLoad(object sender, EventArgs e)
		{
			int count, tmp;
			listWarehouses.fillList();
			
			count = listWarehouses.count();
			DataGridViewColumn []columns = new DataGridViewColumn[count+3];
			tmp =0;
			
			DataGridViewTextBoxColumn id = new DataGridViewTextBoxColumn();
			id.Visible = false;
			id.Name = "id";
			columns[tmp++]= id;
			
			DataGridViewTextBoxColumn product_name = new DataGridViewTextBoxColumn();
			product_name.Name = "product_name";
			product_name.HeaderText = "Produto";
			product_name.Width = 300;
			columns[tmp++]= product_name;
			
			for(int i=0; i < count; i++)
			{
				DataGridViewTextBoxColumn aux = new DataGridViewTextBoxColumn();
				aux.Name = listWarehouses.get(i).name;
				aux.HeaderText = listWarehouses.get(i).name;
				aux.Width = 70;	
				columns[tmp++] = aux;
			}

			DataGridViewTextBoxColumn total = new DataGridViewTextBoxColumn();
			total.Name = "total";
			total.HeaderText = "Total";
			total.Width = 70;
			columns[tmp++] = total;
			
			dgvMain.Columns.AddRange(columns);
		}
		
		private void fillDataGridView()
		{
			
		}
	}
}
